import { createApp, ref, watch } from 'vue'
import './style.css';
import './css/btn.css';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import App from './App.vue'
import router from './router/index'

const app = createApp(App)
app.use(ElementPlus)
app.use(router)

// 是否黑暗模式
let isBlackMode = ref(false);
app.provide('isBlackMode', isBlackMode);
// 是否竖屏
let he = window.innerHeight;
let wi = window.innerWidth;
let isVerticalScreen = ref(false);
isVerticalScreen.value = he / wi > 1;
window.onresize = () => {
    return (() => {
        isVerticalScreen.value = (window.innerHeight / window.innerWidth) > 1;
    })()
}
app.provide('isVerticalScreen', isVerticalScreen);
// 是否顶部
const isTop = ref(true)
app.provide('isTop', isTop);

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

app.mount('#app')
// createApp(App).mount('#app')
